var ss = [
    {
        "attr": "color",
        "name": "颜色",
        "choice": ["black", "silvery"]
    },
    {
        "attr": "size",
        "name": "型号",
        "choice": ["11", "33", '22']
    }/*,
     {
     "attr": "hh",
     "name": "啥",
     "choice": ["yy", "xx"]
     },
     {
     "attr": "hddh",
     "name": "啥啊",
     "choice": ["vv", "bb"]
     }*/
];

function getSKU(ss) {

    var n = 0;
    var obj = ss[n]; //取第一个规格信息
    var yy = [];

    function eachObj(obj, n) { // 递归出所有的规格，每类规格一个数组
        var vv = obj.choice; //规格值
        var attr = obj.attr; //规格名称
        var nn = [];
        for (var a = 0; a < vv.length; a++) {
            var cc = {};
            cc[attr] = vv[a];
            nn.push(cc);
        }
        yy.push(nn);
        n++;
        if (n == ss.length) {
            return;
        }
        obj = ss[n]; //取第n个规格信息
        eachObj(obj, n);
    }

    eachObj(obj, n);
    // console.log('~~~~~~~~~~~~~~~~~~~~');
    // console.log(yy);
    // console.log('~~~~~~~~~~~~~~~~~~~~');
    /*[ [ { color: 'black' }, { color: 'silvery' } ],
     [ { size: '11' }, { size: '33' }, { size: '22' } ] ]*/

    var m = 1;
    var obj1 = yy[m]; //取第一个规格信息
    var zz = [];

    function eachArr(obj, obj1, n) { // 构造规格和规格生成一种商品
        var uu = [];
        for (var i = 0; i < obj.length; i++) { // 循环第一类规格
            for (var j = 0; j < obj1.length; j++) { // 循环第二类规格，和第一种拼接
                var o = {}; //定义一个新的商品
                for (var z in obj[i]) { //循环第一类规格的第i个规格
                    o[z] = obj[i][z]; //将规格和值放到o里面
                }
                for (var p in obj1[j]) { //循环第二类规格的第j个规格
                    o[p] = obj1[j][p]; //将规格和值放到o里面
                }
                uu.push(o); //生成的商品放到数组
            }
        }

        m++; //继续下一类规格新增到商品属性中
        if (m == (yy.length)) { //yy是否还有数据
            zz = uu;
        } else {
            obj1 = yy[m]; // 取第n个规格信息
            eachArr(uu, obj1, n); // 从当前已生成的商品和下一类规格拼接
        }
    }

    eachArr(yy[0], obj1, n); //从第一个和第二个开始

    // console.log(zz);
}

getSKU(ss);

[{
    "color": "black",
    "size": "22.110B",
    "price": "740000",
    "amount": "20",
    "published": "on"
},
    {
        "color": "silvery",
        "price": "770000",
        "size": "22.110SB",
        "amount": "32",
        "published": "on"
    },
    {
        "color": "black",
        "price": "780000",
        "size": "22.110SB",
        "amount": "40",
        "published": "on"
    }
]
